package com.example.qixinshangwutong.model.brand;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

public class MyAdapter<T> extends BaseQuickAdapter<T, BaseViewHolder> {
    private onCallBackData<T> onCallBackData;
    public void setOnCallBackData(onCallBackData<T> onCallBackData) {
        this.onCallBackData = onCallBackData;
    }


    public MyAdapter(int layoutResId, @Nullable List<T> data) {
        super(layoutResId, data);
    }

    public MyAdapter(@Nullable List<T> data) {
        super(data);
    }

    public MyAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder holder, T item) {
        if(onCallBackData!=null){
            onCallBackData.convertView(holder,item);
        }

    }
    public interface onCallBackData<T>{
        void convertView(BaseViewHolder holder,T item);
    }

}
